Skip to content

Jobs entities can't be used after the deletion of an environment#10

Open
danillofb wants to merge 2 commits intowftools:7.x-1.xfrom
danillofb:env_delete_verification_fix
Open

Jobs entities can't be used after the deletion of an environment#10
danillofb wants to merge 2 commits intowftools:7.x-1.xfrom
danillofb:env_delete_verification_fix

Conversation

@danillofb
Copy link

No description provided.

->fields('wf_job')
->condition('eid', $env_id)
->execute()
->rowCount();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inefficient as it iterates over the result set. Please use countQuery like so:

$results = db_select('wf_job', 'wf_job')
    ->fields('wf_job')
    ->condition('eid', $env_id)
    ->countQuery()
    ->execute()
    ->fetchField();

This will use the database's native COUNT() function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants